﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Threading;
using System.Globalization;
/// <summary>
/// Summary description for BasePage
/// </summary>
public class BasePage : System.Web.UI.Page
{
    protected override void InitializeCulture()
    {
        string culture = string.Empty;
        if (Request.Cookies["lang"] != null)
        {
            culture = Request.Cookies["lang"].Value;
        }
        else
        {
            var language =new  HttpCookie("lang");
            language.Value = "vi-VN";
            language.Expires = DateTime.Now.AddMonths(1);
            Response.Cookies.Add(language);
        }
        Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
        Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
        base.InitializeCulture();
    }
}